<?php
namespace Admin\Controller;
use Think\Controller;
class ChearkLoginController extends Controller {
        function _initialize(){
            $accessUrls = session('accessUrls');
            $url = '/'. CONTROLLER_NAME.'/'.ACTION_NAME;
//            var_dump($accessUrls) ;
//            echo $url;
//            echo $accessUrls[$url];
            if(empty($accessUrls) || empty($accessUrls[$url])){
                session(null);
                header('HTTP/1.1 403');
                header('Content-Type:text/html;charset=UTF-8');
                echo '<script>alert("请登录！在来哦^_^"); location="'.U('Index/index').'";</script>';
                return;
            }

            $userid = $this->nameId = session('role_id');
        }
}